package com.cjq.system.controller;

import com.cjq.common.domain.SysUser;
import com.cjq.common.result.Result;
import com.cjq.system.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class SysUserController {
    @Autowired
    private SysUserService sysUserService;

    /**
     * 根据账号查询用户
     * @param userName
     * @return
     */
    @GetMapping("/findUser/{userName}")
    public Result<SysUser> findUser(@PathVariable String userName){
        return sysUserService.findUser(userName);
    }
}
